﻿﻿using System;
using System.Collections.Generic;
using System.Text;
namespace WebApplication1.DDD.Models.Entity.Common
{
    public class sign_up:NFinal.Struct
    {
		public System.Int64 id;
		public System.String name;
		public System.Int64? type;
		public System.String mobile;
		public System.String site_url;
		public System.String attr1;
		public System.String attr2;
		public System.String attr3;
		public System.String attr4;
		#region 从get列表初始化实体类
		public static bool TryParse(NFinal.NameValueCollection get,out sign_up par)
		{
			par=new sign_up();
			try
			{
						System.Int64.TryParse(get["id"],out par.id);
						par.name=get["name"];
						par.type=null;
						if(get["type"]!=null)
						{
							par.type=System.Int64.Parse(get["type"]);
						}
						par.mobile=get["mobile"];
						par.site_url=get["site_url"];
						par.attr1=get["attr1"];
						par.attr2=get["attr2"];
						par.attr3=get["attr3"];
						par.attr4=get["attr4"];
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public override void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"id\":");
					tw.Write(id.ToString());
					tw.Write(",");
					tw.Write("\"name\":");
					tw.Write("\"");
					tw.Write(name==null?"null":name);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"type\":");
					tw.Write(type==null?"null" : type.ToString());
					tw.Write(",");
					tw.Write("\"mobile\":");
					tw.Write("\"");
					tw.Write(mobile==null?"null":mobile);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"site_url\":");
					tw.Write("\"");
					tw.Write(site_url==null?"null":site_url);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"attr1\":");
					tw.Write("\"");
					tw.Write(attr1==null?"null":attr1);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"attr2\":");
					tw.Write("\"");
					tw.Write(attr2==null?"null":attr2);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"attr3\":");
					tw.Write("\"");
					tw.Write(attr3==null?"null":attr3);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"attr4\":");
					tw.Write("\"");
					tw.Write(attr4==null?"null":attr4);
					tw.Write("\"");
			tw.Write("}");
		}
		#endregion
    }
}
